package com.zealfi.wk.feign.service;

import com.zealfi.wk.api.pojo.User;
import com.zealfi.wk.feign.service.fallback.HelloServiceFallback;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.*;

/**
 * Created by kuan at 2018-04-23 下午 4:37
 */
@FeignClient(value = "hello-service", fallback = HelloServiceFallback.class)
public interface FeignHelloService {

    @RequestMapping("hello")
    String hello();

    @RequestMapping(value = "hello/1", method = RequestMethod.GET)
    String hello(@RequestParam("name") String name);

    @RequestMapping(value = "hello/2", method = RequestMethod.GET)
    User hello(@RequestHeader("name") String name, @RequestHeader("age") Integer age);

    @RequestMapping(value = "hello/2", method = RequestMethod.POST)
    String hello(@RequestBody User user);
}
